﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Danser_Entity.Entities
{
    /// <summary>
    /// Entity represents data of a favorite user query
    /// </summary>
    public class UserQuery
    {
        #region Members:

        /// <summary>
        /// unique identifier for the query
        /// </summary>
        public int ID;
        /// <summary>
        /// unique identifier for the user who owns the query
        /// </summary>
        private String _userID;
        /// <summary>
        /// represntation of the query
        /// </summary>
        private String _queryString;
        /// <summary>
        /// sname for the query
        /// </summary>
        private String _name;
        /// <summary>
        /// description of what the query does
        /// </summary>
        private String _desc;

        #endregion

        #region C'tors:

        /// <summary>
        /// creates an empty UserQuery instance
        /// </summary>
        public UserQuery() { }

        /// <summary>
        /// creates a UserQuery instance with the given pararmeters
        /// </summary>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <param name="query"></param>
        /// <param name="userID"></param>
        public UserQuery(String name, String description, String query, String userID)
        {
            _name = name;
            _desc = description;
            _queryString = query;
            _userID = userID;
        }

        #endregion

        #region Properties:

        /// <summary>
        /// property
        /// </summary>
        public String UserID
        {
            get { return _userID; }
            set { _userID = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public String QueryString
        {
            get { return _queryString; }
            set { _queryString = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public String Name
        {
            get { return _name; }
            set { _name = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public String Description //A property for 'desc' field
        {
            get //to avoid potential null exceptions
            {
                return _desc == null ? "" : _desc;
            }
            set { _desc = value; }
        }

        #endregion
    }
}
